package com.lw.nacos.client.repositories;

import com.lw.nacos.client.pojo.Stock;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface StockRepository extends CrudRepository<Stock, Long>{

    @Query("FROM  Stock s WHERE s.productId = ?1")
    Stock findByProductId(Long id);
}
